#import "HeatwaveKeepsakeController.h"
        
#import "HeatwaveKeepsakeModel.h"
#import "HeatwaveKeepsakeCell.h"
#import "Masonry.h"

@interface HeatwaveKeepsakeController () <UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, strong) UITableView *doodleTableView;
@property (nonatomic, strong) NSMutableArray *radianceModels;

@end

@implementation HeatwaveKeepsakeController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self oasisMellowConfigsview];
	[self circulateZephyrloadData];
}


//: 懒加载数据模型数组
- (NSMutableArray *)radianceModels {
	if (!_radianceModels) {
		_radianceModels = [NSMutableArray array];
	}
	return _radianceModels;
}

//: 获取数据模型
- (void)circulateZephyrloadData {
	
}

//: 初始化页面UI
- (void)oasisMellowConfigsview {

	[self.view addSubview:self.doodleTableView];
	[self.doodleTableView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.leading.trailing.equalTo(self.view);
		make.top.equalTo(self.view);
		make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
	}];
}


- (UITableView *)figHandleTableView {
    if (!_doodleTableView) {
        _doodleTableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
        _doodleTableView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
        _doodleTableView.estimatedRowHeight = 0;
        _doodleTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        _doodleTableView.contentInset = UIEdgeInsetsMake(16, 0, 16, 0);
        _doodleTableView.delegate = self;
        _doodleTableView.dataSource = self;
        _doodleTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
        _doodleTableView.showsVerticalScrollIndicator = NO;
        _doodleTableView.showsHorizontalScrollIndicator = NO;
        _doodleTableView.backgroundColor = UIColor.clearColor;
    }
    return _doodleTableView;
}

#pragma mark - UITableView DataSource 
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.radianceModels.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    HeatwaveKeepsakeCell *quake = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([HeatwaveKeepsakeCell class])];
    if (quake == nil) {
        quake = [[HeatwaveKeepsakeCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:NSStringFromClass([HeatwaveKeepsakeCell class])];
    }
    quake.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return quake;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
	HeatwaveKeepsakeModel *amberVolatileLiberty = self.radianceModels[indexPath.row];
	return amberVolatileLiberty.rebirthWhisperOracleCellHeight;
}


#pragma mark - UITableView Delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // cell tap action
}


@end
